package com.tiancheng.trade.authserver.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

@TableName("auth_role")
@Getter
@Setter
public class AuthRole extends BaseDataPermissionModel {
    private String roleName;
    private String roleCode;
    private String describe;
    private String applicationId;
    private Long parentId;
    private String parentIds;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof AuthRole)) {
            return false;
        }
        AuthRole that = (AuthRole) o;
        if (that.getId().equals(this.getId())) {
            return true;
        } else {
            return Objects.equals(this.getRoleCode(), that.getRoleCode()) && Objects.equals(this.getApplicationId(), that.getApplicationId());
        }
    }

    @Override
    public int hashCode() {
        return Objects.hash(this.getRoleCode(), this.getApplicationId());
    }
}

